Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an Argo-based mechanism to periodically refresh PostgreSQL materialized views in the Kubernetes “welearn-datastack” deployment, backed by a reusable refresh script.
Changes:
- Added a Bash script to refresh a specified PostgreSQL materialized view.
- Added an Argo
WorkflowTemplateto refresh three specific materialized views. - Added an Argo
CronWorkflowto run the refresh workflow every 3 hours.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
script/update-materialized-view |
New Bash helper to run REFRESH MATERIALIZED VIEW CONCURRENTLY using env-provided DB credentials. |
k8s/welearn-datastack/templates/updateMaterializedViews/workflow-template.yaml |
New Argo WorkflowTemplate + CronWorkflow to execute the refresh script for multiple views on a schedule. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
k8s/welearn-datastack/templates/updateMaterializedViews/workflow-template.yaml
Outdated
Show resolved
Hide resolved
k8s/welearn-datastack/templates/updateMaterializedViews/workflow-template.yaml
Outdated
Show resolved
Hide resolved
k8s/welearn-datastack/templates/updateMaterializedViews/workflow-template.yaml
Outdated
Show resolved
Hide resolved
k8s/welearn-datastack/templates/updateMaterializedViews/workflow-template.yaml
Outdated
Show resolved
Hide resolved
k8s/welearn-datastack/templates/updateMaterializedViews/workflow-template.yaml
Outdated
Show resolved
Hide resolved
…ow-template.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… for improved view refresh
Guillaume302
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new workflow for updating PostgreSQL materialized views in a Kubernetes environment using Argo Workflows. It adds a reusable workflow template and a supporting shell script to automate the refresh process for multiple materialized views, and schedules this operation to run every three hours.
Argo Workflow and CronWorkflow for Materialized Views:
updateMaterializedViews/workflow-template.yamldefining an ArgoWorkflowTemplateand aCronWorkflowto automate the refresh of three materialized views (qty_document_in_qdrant,qty_document_in_qdrant_per_corpus, andqty_document_per_corpus) every three hours. The workflow uses a parameterized template to call a script for each view and includes security context and secret handling.Script for Refreshing Materialized Views:
script/update-materialized-view, a Bash script that receives a materialized view name as an argument and refreshes it in PostgreSQL using credentials provided via environment variables. The script includes error handling and outputs status messages for observability.